<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.util.List" %>
<%@ page import="po.User" %>
<%@ page import="dao.UserDao" %>
<%@ page import="dao.impl.UserDaoImpl" %>
<%@ page import="java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>用户登录</title>
</head>
<body>
<%
    User user = new User();
    UserDao dao = new UserDaoImpl();

    String username = request.getParameter("username");
    String password = request.getParameter("password");
    user.setUsername(username);
    user.setPassword(password);
    User us = dao.login(user);

    if (us != null) {
        response.sendRedirect("../myHomePage.jsp");
    } else{
        response.sendRedirect("loginFail.jsp");
    }
%>
</body>
</html>
